<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__STATIC__/index/css/center2.css">
    <link rel="stylesheet" href="__STATIC__/index/css/newgoods.css">
    <link rel="stylesheet" href="__STATIC__/index/css/quan_common.css">
    <link rel="stylesheet" href="__STATIC__/index/css/single.css">
    <link rel="stylesheet" href="__STATIC__/index/css/common.css">
    <link rel="stylesheet" href="__STATIC__/index/css/center2.css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
    <script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <title>提现</title>
    <style media="screen">
      a.ivu-menu-item{
            color: #4c6cc9;
      }
      #checked_it{
          display: flex;
          flex-direction: row;
          justify-content: space-around;
      }
      #checked_it .close_it, #checked_it .sure_it{
          font-size: 14px;
          padding: 5px 20px;
          background: #4c6cc9;
          color: #fff;
          border-radius: 3px;
          cursor:pointer;
      }
      .close_it{
          background: #4c6cc9;
      }
    </style>
</head>

<body>
	{include file='common/heade'}
	   <div class="ext-center" style="min-height: 1000px;">
        <div class="single_center w_1200">
    		    {include file='common/left_tg'}
            <div class="ext-right">
                <div class="ivu-modal-header">
                    <div class="ivu-modal-header-inner">提现</div>
                </div>
                <div class="ivu-modal-body">
                    <form autocomplete="off" class="ivu-form ivu-form-label-right" method="post" action="{:url('cash')}">
                        <!-- 身份证号 -->
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">结算账号</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <span style="padding: 10px;font-size: 1.6rem;font-weight: 900;">{$data.credit}</span>
                                </div>
                            </div>
                        </div>
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">当前余额</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <span style="padding: 10px;font-size: 1.6rem;font-weight: 900;">{$userInfomation.balance}元</span>
                                </div>
                            </div>
                        </div>
                        <div class="ivu-form-item ivu-form-item-required">
                            <label class="ivu-form-item-label" style="width: 90px;">提现金额</label>
                            <div class="ivu-form-item-content" style="margin-left: 90px;">
                                <div class="w276 ivu-input-wrapper ivu-input-type">
                                    <i class="ivu-icon ivu-icon-load-c ivu-load-loop ivu-input-icon ivu-input-icon-validate"></i>
                                    <input autocomplete="off" spellcheck="false" type="number" placeholder="请输入您要充值的金额" name="account" class="ivu-input">
                                </div>
                            </div>
                        </div>
                        <div id="checked_it" class="w276">
                            <div class="close_it">取消</div>
                            <div class="sure_it" onclick="submitMyForm();">确定</div>
                        </div>
                    </form>
                </div>
                <div class="ivu-modal-footer">
                    <span class="dialog-footer"></span>
                </div>
            </div>
        </div>
  	</div>
    {include file='common/bottom'}
</body>
<!-- <script src="__STATIC__/layer/layer.js"></script> -->
<script>
    layui.use('layer', function(){
        var layer = layui.layer;
    });

    function submitMyForm() {
        var account = $('input[name="account"]').val();
        if(account < 0 || account > parseInt('{$userInfomation.balance}')){
            layer.msg('请填写正确的提现金额', {icon: 2,time:1500,shade: 0.1});return false;
        }
        $.post('{:url("cash")}',{'account':account},function(data){
            // console.log(data);
            if(data.code == 1){
                layer.msg(data.msg, {
                    icon: 1,time:1000
                },function(){
                    window.location.reload()
                });
            }else{
                layer.msg(data.msg, {icon: 1,time:1000},function(){
                    layer.close(index);
                });
            }
        },'json')
    }
</script>
</html>
